package com.bookcode.controller;

import com.bookcode.entity.Course;
import com.bookcode.entity.HttpResult;
import com.bookcode.entity.Queqin;
import com.bookcode.service.QueqinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: 刘浩然
 * @Date: 2020/10/23 12:07
 */
@RestController
public class QueqinController {
    @Autowired
    QueqinService queqinService;
    @GetMapping(value = "/findQueqin")
    public HttpResult findAll(){
        HttpResult<List<Queqin>> httpResult=new HttpResult<>();
        try{
           httpResult.setData(queqinService.findAll()) ;
        }catch (Exception e){
            httpResult.setMessage("查询失败");
        }finally {
            return httpResult;
        }

    }
}
